package com.sinochem.yunlian.ship.common.util;

import com.google.common.base.Charsets;

import java.net.URLDecoder;

/**
 * @Author: chengyiping
 * @Email: chengyiping@sinochem.com
 * @Description:
 * @Date: Created in 2018/3/5 17:43
 * @Modified By :
 */
public class URLDecodeUtil {

    /**
        *
        * @Author: chengyiping
        * @Description:
        * @Date: Created in 2018/3/5 17:46
        * @Modified By :
        * @Version:
    */
    public static String decodeData(String data) {
        try {
            return URLDecoder.decode(data.toString().replaceAll("%", "%25").replaceAll("\\+", "%2B"),
                    Charsets.UTF_8.name());
        }catch (Exception e){
        }
        return "";
    }
}
